<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/jquery/jquery.min.js"></script>
    <script src="lib/vue/vue.js"></script>
    <script src="res/controller/commonController.js"></script>
    <script src="res/controller/requestController.js"></script>
</head>
<body>
<div id="test">
    <span @click="a()">打印Token</span></br>
    <span @click="c()">获取临时Token</span></br>
    <input id="pass">
    <span @click="b()">密码加密</span></br>
    <span @click="d()">首页数据</span></br>
    app<input v-model="app">model<input v-model="model">
    <span @click="e()">ModelJson</span></br>
</div>

</body>
<script>
    var test = new Vue({
        el: '#test',
        data: {
            name: 'Vue.js',
            request: new requestController(),
            app:'',
            model:''
        },
        mounted:function () {

        },
        // 在 `methods` 对象中定义方法
        methods: {
            b: function () {
                var _self = this;
                var jsonData = {};
                jsonData.source = $("#pass").val();
                _self.request.setApiName("/Encrypt");
                _self.request.setRequest(jsonData);
                _self.request.post();
                console.log(_self.request.getResponse());
            },
            a:function () {
                console.log(this.request.getToken());
            },
            c:function () {

                    this.request.setApiName("/Token");
                    this.request.setRequest();
                    this.request.post();
                    console.log(this.request.getResponse());


            },
            d:function () {
                for(var i = 0;i < 1; i--){
                    var jsonData = {};
                    this.request.setApiName("/App/Home");
                    this.request.setRequest(jsonData);
                    this.request.post();
                    console.log(this.request.getResponse());
                    console.log(i);
                }
            },
            e:function () {
                var jsonData = this.request.getJsonModel(this.app,this.model);
                console.log(jsonData);
            }
        }
    })

</script>
</html>